package com.boot.springboot.pojo.dto;

import jakarta.persistence.Column;
import jakarta.validation.constraints.*;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.NumberFormat;

public class  StaffDto {
    @NotNull(message = "id不能为空")
    @Min(value = 10000, message = "商品ID至少10000以上") // 最小10000（5位）
    @Max(value = 100000, message = "商品ID最多100000以下") // 最大100000（6位）
    private Integer staffId;
    @NotBlank(message = "名字不能为空")
    private String staffName;
    @NotBlank(message = "性别不能为空")
    private String staffSex;
    @NotNull(message = "账号不能为空")
    @Min(value = 1000000000, message = "至少10位")
    @Min(value = 999999999, message = "最多10位")
    private Integer staffAccount;
    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 12)
    private String staffPassword;
    @Pattern(regexp = "^\\d{11}$", message = "手机号必须为11位数字")
    private String staffPhone;
    @Email(message = "邮箱格式不正确")
    private String staffEmail;

    public @NotNull(message = "id不能为空") @Min(value = 10000, message = "商品ID至少10000以上") @Max(value = 100000, message = "商品ID最多100000以下") Integer getStaffId() {
        return staffId;
    }

    public void setStaffId(@NotNull(message = "id不能为空") @Min(value = 10000, message = "商品ID至少10000以上") @Max(value = 100000, message = "商品ID最多100000以下") Integer staffId) {
        this.staffId = staffId;
    }

    public @NotBlank(message = "名字不能为空") String getStaffName() {
        return staffName;
    }

    public void setStaffName(@NotBlank(message = "名字不能为空") String staffName) {
        this.staffName = staffName;
    }

    public @NotBlank(message = "性别不能为空") String getStaffSex() {
        return staffSex;
    }

    public void setStaffSex(@NotBlank(message = "性别不能为空") String staffSex) {
        this.staffSex = staffSex;
    }

    public @NotNull(message = "账号不能为空") @Min(value = 1000000000, message = "至少10位") @Min(value = 999999999, message = "最多10位") Integer getStaffAccount() {
        return staffAccount;
    }

    public void setStaffAccount(@NotNull(message = "账号不能为空") @Min(value = 1000000000, message = "至少10位") @Min(value = 999999999, message = "最多10位") Integer staffAccount) {
        this.staffAccount = staffAccount;
    }

    public @NotBlank(message = "密码不能为空") @Length(min = 6, max = 12) String getStaffPassword() {
        return staffPassword;
    }

    public void setStaffPassword(@NotBlank(message = "密码不能为空") @Length(min = 6, max = 12) String staffPassword) {
        this.staffPassword = staffPassword;
    }

    public @Pattern(regexp = "^\\d{11}$", message = "手机号必须为11位数字") String getStaffPhone() {
        return staffPhone;
    }

    public void setStaffPhone(@Pattern(regexp = "^\\d{11}$", message = "手机号必须为11位数字") String staffPhone) {
        this.staffPhone = staffPhone;
    }

    public @Email(message = "邮箱格式不正确") String getStaffEmail() {
        return staffEmail;
    }

    public void setStaffEmail(@Email(message = "邮箱格式不正确") String staffEmail) {
        this.staffEmail = staffEmail;
    }

    @Override
    public String toString() {
        return "StaffDto{" +
                "staffId=" + staffId +
                ", staffName='" + staffName + '\'' +
                ", staffSex='" + staffSex + '\'' +
                ", staffAccount=" + staffAccount +
                ", staffPassword='" + staffPassword + '\'' +
                ", staffPhone='" + staffPhone + '\'' +
                ", staffEmail='" + staffEmail + '\'' +
                '}';
    }
}